<?php

namespace app\admin\model\train;

use think\Model;
use think\Db;

class Peixuntime extends Model
{

    

    

    // 表名
    protected $name = 'train_time';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];
    
    public function gettrain(){
        $traintitle =  Db::name('train')->order('id desc')->select();
         return $traintitle;
     }

     public function Peixun()
    {
        return $this->belongsTo('Peixun', 'train_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
     
    


}
